package xmarti.vacaxm.beans.connect;

import java.util.Objects;
/**
 * @class   Classe que representa al tipus d'un origen 
 * @author  Xavier Martí 
 */
public class TypeOrigin implements java.io.Serializable {	 
     private int id;
     private String name;
     private String description; 
     /**
      * @build    per defecte
      */
     public TypeOrigin(){

     }
     /**
      * @build amb dos paràmetre  
      * @param name identificador visual    
      */
     public TypeOrigin ( String name){
        this.name=name;
     }
    public TypeOrigin ( String name, String description){
        this.name=name;
        this.description=description;
     }

    /**
     * @readAccessor 
     * @return identificador intern
     */
    public int getId() {
            return id;
    }
    /**
     * @writeAcessor
     * @param id identificador intern
     */
    public void setId(int id) {
            this.id = id;
    }
    /**
     * @return the name
     */
    public String getName() {
            return name;
    }
    /**
     * @param name the name to set
     */
    public void setName(String name) {
            this.name = name;
    }
    /**
     * @readAccessor
     * @return Descripció del tipus d'origen
     */
    public String getDescription() {
    return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 61 * hash + Objects.hashCode(this.name);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final TypeOrigin other = (TypeOrigin) obj;
        if (!Objects.equals(this.name, other.name)) {
            return false;
        }
        return true;
    }
    
     @Override
    public String toString(){
        return this.name; 
    }
    
}
